package com.itheima.app.controller;

import com.itheima.app.manager.AcousticManger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/*
桃花传音
 */
@RestController
public class AcousticCollection {

    @Autowired
    private AcousticManger acousticManger;

    //表单提交          发送语言
    @PostMapping("/peachblossom")
    public void sendAcoustic(MultipartFile soundFile) throws IOException {

        acousticManger.sendAcoustic(soundFile);
    }


    //接收语音
    @GetMapping("/peachblossom")
    public ResponseEntity findAcoustic() {


       return  acousticManger.findAcoustic();
    }
}
